{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Plots Update Seamlessly\n",
    "\n",
    "After a BeakerX Plot has been displayed, you can interact with it with the mouse.  You can also interact with it by API, and the plot will update seamlessly in its previously displayed location."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot = new Plot(title: \"Setting line properties\", initHeight: 150)\n",
    "def ys = [0, 1, 6, 5, 2, 8]\n",
    "def ys2 = [0, 2, 7, 6, 3, 8]\n",
    "plot << new Line(y: ys, width: 10, color: Color.red)\n",
    "plot << new Line(y: ys, width: 3, color: Color.yellow)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot.setTitle(\"Changed Title\");\n",
    "OutputCell.HIDDEN"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot.setInitWidth(500)\n",
    "OutputCell.HIDDEN"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot << new Line(y: [5, 0], x: [0, 5], style: StrokeType.LONGDASH)\n",
    "OutputCell.HIDDEN"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ch = new Crosshair(color: new Color(255, 128, 5), width: 2, style: StrokeType.DOT)\n",
    "plot.setCrosshair(ch)\n",
    "OutputCell.HIDDEN"
   ]
  }
 ],
 "metadata": {
  "beakerx_kernel_parameters": {},
  "kernelspec": {
   "display_name": "Groovy",
   "language": "groovy",
   "name": "groovy"
  },
  "language_info": {
   "codemirror_mode": "groovy",
   "file_extension": ".groovy",
   "mimetype": "",
   "name": "Groovy",
   "nbconverter_exporter": "",
   "version": "2.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
